#import <Foundation/Foundation.h>
#import <AFNetworking/AFHTTPSessionManager.h>
#import "RNNetworkParam.h"
@interface RPNetworkTool : AFHTTPSessionManager

/// 工具类
+ (instancetype)sharedTool;

/// 获取完整路径
+ (NSString *)getRequestURLWithAPI:(NSString *)api;

/// 基于AFN的GET封装
/// @param URLString 请求路径
/// @param parames 入参对象
/// @param success 成功回调
/// @param failure 错误回调
  - (void)requestGET:(NSString *)URLString
             parames:(id)parames
             success:(void (^)(id responseObj))success
             failure:(void (^)(id error))failure;
/// 基于AFN的POST封装
/// @param URLString 请求路径
/// @param parames 入参对象
/// @param success 成功回调
/// @param failure 错误回调
- (NSURLSessionTask *)requestPOST:(NSString *)URLString
            parames:(id)parames
            success:(void (^)(id responseObj))success
            failure:(void (^)(id error))failure;
/// 上传图片
/// @param URLString 请求路径
/// @param parameters 入参对象
/// @param uploadParams 上传图片的信息
/// @param success 成功回调
/// @param failure 错误回调
- (void)uploadWithURLString:(NSString *)URLString
           parameters:(id)parameters
          uploadParam:(NSArray <RNNetworkParam *> *)uploadParams
                    success:(void (^)(id responseObj))success
              failure:(void (^)(NSError *error))failure;
/// 下载数据
/// @param URLString 请求路径
/// @param parameters 入参对象
/// @param progress nil
/// @param success 成功回调
/// @param failure 错误回调
- (void)downLoadWithURLString:(NSString *)URLString
             parameters:(id)parameters
                     progerss:(void (^)(void))progress
                      success:(void (^)(void))success
                failure:(void (^)(NSError *error))failure;

@end
